<?php 
$xhtml = "";
foreach ($allposts as $key => $posts) {
	$xhtml .= "<div class=posts> 
					
					<div class='comments-count'>
						<a href='#'><small><strong>51</strong> comments</small></a>
						<div class='date-added'>".$posts->dateadded."</div> 
					</div> 

					<div class='description'> 
						<a href='#'><h2>".$posts->title."</h2></a>
						<p>".$posts->description."</p>
					</div> 
					
					<div class='image-holder'>
					<img src=".$posts->imageurl." />
								
					<div class='image-caption'>".$posts->caption."</div>
				</div>
			</div>";
}
echo $xhtml;
echo $this->pagination->create_links();